clear
use Conjoint.dta


*Table 5
reg Y i.A1L1 i.A1L3 i.A3L1  i.A2L2  i.A2L3 i.A4L2
outreg2 using a.doc, replace label

reg Y i.A3L1 i.A2L2  i.A2L3  i.A4L2 if A1L1==1
outreg2 using a.doc, append label ctitle(Good)
estimates store Y1

reg Y i.A3L1 i.A2L2  i.A2L3  i.A4L2 if A1L2==1
outreg2 using a.doc, append label ctitle(Moderate)
estimates store Y2

reg Y i.A3L1 i.A2L2  i.A2L3  i.A4L2 if A1L3==1
outreg2 using a.doc, append label ctitle(Bad)
estimates store Y3

reg Y i.A1L1 i.A1L3 i.A3L1  i.A2L2  i.A2L3 i.A4L2 i.A3L1#i.A1L1 i.A3L1#i.A1L3 
outreg2 using a.doc, append label

reg Y i.A1L1 i.A1L3 i.A3L1  i.A2L2  i.A2L3 i.A4L2 i.A3L1#i.A1L3 if A1L2!=1
outreg2 using a.doc, append label


*Appendix E1
reg Y A3L1 A2L2  A2L3  A4L2 if A1L1==1
outreg2 using a.doc, append label ctitle(Good)
estimates store Y1

reg Y A3L1 A2L2  A2L3  A4L2 if A1L2==1
outreg2 using a.doc, append label ctitle(Moderate)
estimates store Y2

reg Y A3L1 A2L2  A2L3  A4L2 if A1L3==1
outreg2 using a.doc, append label ctitle(Bad)
estimates store Y3

coefplot Y1, bylabel(COVID good) msize(vsmall) || Y2, bylabel(COVID not so good) msize(vsmall)|| Y3, bylabel(COVID bad) msize(vsmall)||, drop(_cons) xline(0, lcolor(black) lpattern(dot)) byopt(row(3)) graphregion(color(white))  coeflabels(,labsize(small)) 


*Appendix E2
coefplot (Y1, keep(A3L1) asequation(COVID good))(Y2, keep(A3L1) asequation(COVID not so good))(Y3, keep(A3L1) asequation(COVID bad)), coeflabels(,labsize(small)) swapnames legend(off) mcolor(black) ciopts(color(black))  graphregion(color(white))
